-- increase_attack
-- created by panyl
-- 每若干轮攻击+N

return {
    apply = function(prop, baseValue)
        return baseValue + prop[3];
    end,

    -- 每回合触发
    trigger = function(who, prop, arg)
        local pos = who:getOwner();
        local grid = DungeonM.getGridByPos(pos);
        local openRound = grid.openRound or 1;
        local round = CombatM.getRound();

        local step = tonumber(prop[2]);
        local add  = tonumber(prop[3]);
        who.dbase:setTemp("attack_addon", math.modf((round - openRound) / step) * add);

        if (round - openRound) % step == 0 then
            EventMgr.fire(event.MONSTER_INFO_UPDATED, {["pos"] = pos, })
        end

        return true;
    end,

    record = function(target, prop, path)
        return false;
    end
};
